
import java.util.Collection;
import java.util.ArrayList;
import java.util.Iterator;
public class ddq_bl
{
    public static void main(String[] args){
    Collection<String> x = new ArrayList<String>();
    //清空
    x.clear();
    //添加
    x.add("q");
    x.add("w");
    x.add("e");
    x.add("e");
    x.add("r");
    x.add("t");
    //删除
    x.remove("e");
    //判断是否有
    if(x.contains("q")){
        System.out.println("have q");
    }else{
        System.out.println("no q");
    };
    //判断是否空
    if(x.isEmpty()){
        System.out.println("empty");
    }else{
        System.out.println("no empty");
    };
    //返回长度
    int size = x.size();
    System.out.println("长度"+size);
    
    Iterator<String> c=x.iterator();
    while(c.hasNext()){
        System.out.println(c.next());
    }
    
    }
}
